package demo1;

class Student {

}
class Teacher {

}
class School {
    public Student[] students; //默认是null
    public Teacher[] teachers;
    public int a;

    public School() {
        this.students = new Student[10];
        this.teachers = new Teacher[10];
        this.a = 10;
    }
}

public class Test {

}


class Shape {
    public void draw() {
        System.out.println("画一个图形！");
    }
}

class Rect extends Shape {
    @Override
    public void draw() {
        System.out.println("⬜！");
    }
}

class Triangle extends Shape {
    @Override
    public void draw() {
        System.out.println("🔺！");
    }
}

class Cycle extends Shape {
    @Override
    public void draw() {
        System.out.println("⚪！");
    }
}

class Flower extends Shape {
    @Override
    public void draw() {
        System.out.println("❀！");
    }
}
//public class Test {
//
//    public static void drawMap(Shape shape){
//        shape.draw();
//    }
//
//    public static void main(String[] args) {
//        Shape shape1 = new Cycle();
//        Shape shape2 = new Triangle();
//        Shape shape3 = new Rect();
//        Shape shape4 = new Flower();
//
//        Shape[] shapes = {shape2,shape4,shape3,shape1,shape4,shape3,shape2,shape4};
//        for(Shape shape:shapes){
//            shape.draw();
//            drawMap(shape);
//        }
//
//    }
//
//    public static void main1(String[] args) {
//        Cycle cycle = new Cycle();
//        Rect rect = new Rect();
//        Triangle triangle = new Triangle();
//        String[] strings = {"cycle","rect","cycle","rect","triangle"};
//        for(String x:strings) {
//            if(x.equals("cycle")){
//                cycle.draw();
//            }else if (x.equals("rect")) {
//                rect.draw();
//            }else if (x.equals("triangle")){
//                triangle.draw();
//            }
//        }
//    }
//}
